<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>添加权限</title>
        <meta http-equiv="content-type" content="text/html   charset=UTF-8">
        <link href="/tgyun/taiguyun/Public/css/mine.css" rel="stylesheet" type="text/css"/>
        <style type="text/css">
            {literal}
            li{list-style: none;}
            {/literal}
        </style>
    </head>

    <body>

        <div class="div_head">
            <span>
                <span style="float:left">当前位置是：角色管理-》为角色分配权限</span>
                <!--<span style="float:right;margin-right: 8px;font-weight: bold">-->
                    <!--<a style="text-decoration: none" href="<?php echo ($smarty["const"]["/tgyun/taiguyun/index.php/Admin"]); ?>/Goods/showlist">【返回】</a>-->
                <!--</span>-->
                 <span style="float:right;margin-right: 8px;font-weight: bold">
                    <a style="text-decoration: none" href="/tgyun/taiguyun/index.php/Admin/Role/showlist">【返回角色列表】</a>
                </span>
            </span>
        </div>
        <div></div>

        <div style="font-size: 13px;margin: 10px 5px">
            <form action="/tgyun/taiguyun/index.php/Admin/Role/distribute/role_id/2" method="post" enctype="multipart/form-data">
                <div>正在为角色：<span style="font-size:25px; font-weight:bold;"><?php echo ($role_name); ?></span>分配权限</div>
                <!--{*首先显示父级权限，在内部嵌套判断显示对应的子级权限 ul  li*}-->
                <ul>
                    <?php if(is_array($pauth_info)): foreach($pauth_info as $key=>$v): ?><!--{foreach $pauth_info as $k => $v}-->
                    <li><?php echo ($v["auth_name"]); ?>
                        <input type="checkbox" name="authname[]" value="<?php echo ($v["auth_id"]); ?>"
                         <?php if(in_array(($v["auth_id"]), is_array($auth_ids_arr)?$auth_ids_arr:explode(',',$auth_ids_arr))): ?>checked='checked'<?php endif; ?> />
                                             <!--{if in_array($v.auth_id,$auth_ids_arr) }checked='checked'{/if}-->



<ul>
    <?php if(is_array($sauth_info)): foreach($sauth_info as $key=>$vv): if(($v["auth_id"]) == $vv["auth_pid"]): ?><li>
        <?php echo ($vv["auth_name"]); ?>
        <input type="checkbox" name="authname[]" value="<?php echo ($vv["auth_id"]); ?>"
        <?php if(in_array(($vv["auth_id"]), is_array($auth_ids_arr)?$auth_ids_arr:explode(',',$auth_ids_arr))): ?>checked='checked'<?php endif; ?> />
        <ul>
            <?php if(is_array($tauth_info)): foreach($tauth_info as $key=>$vvv): if(($vv["auth_id"]) == $vvv["auth_pid"]): ?><li>
                        <?php echo ($vvv["auth_name"]); ?>
                        <input type="checkbox" name="authname[]" value="<?php echo ($vvv["auth_id"]); ?>"
                        <?php if(in_array(($vvv["auth_id"]), is_array($auth_ids_arr)?$auth_ids_arr:explode(',',$auth_ids_arr))): ?>checked='checked'<?php endif; ?> />
                    </li><?php endif; endforeach; endif; ?>
        </ul>
    </li><?php endif; endforeach; endif; ?>
</ul>



                   </li><?php endforeach; endif; ?>
                </ul>
                <input type="submit" value="分配权限" />
            </form>
        </div>
    </body>
</html>